using UnityEngine;
using System.Collections;

public class BlowOutLight : MonoBehaviour {
	
	public Transform target;
	public Light lamp;
	public float burnOutDistance;
	
	void Update () {
		float distance = Vector3.Distance(target.position, transform.position);
		if(distance < burnOutDistance){
			lamp.enabled = false;
		}
	}
}
